package rtti;

import framework.AbstractTest;
import utils.Log;

/**
 * Created by shane on 2018/6/12.
 */
public class WildcardClassReferences extends AbstractTest {

    @Override
    public void test(String[] args) {
        super.test(args);

        Class<?> intClass = int.class;
        //intClass = double.class;
        boolean isInstance = intClass.isInstance(3);
        Log.vn("isInstance:" + isInstance);

        Class<? extends Number> numberClass = Integer.class;
        isInstance = numberClass.isInstance(3);
        Log.vn("isInstance2:" + isInstance);

        numberClass = int.class;
        isInstance = numberClass.isInstance(3);
        Log.vn("isInstance2.5:" + isInstance);

        isInstance = Number.class.isInstance(3);
        Log.vn("isInstance3:" + isInstance);

        isInstance = (Integer.valueOf(3)) instanceof Number;
        Log.vn("isInstance4:" + isInstance);



    }
}
